home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-13
/
tsqed16.zip
/
DATE.QMA
< prev
next >
Wrap
Text File
|
1992-01-01
|
4KB
|
138 lines
* All rights reserved
* Date commands giving the month as three letters (as below)
* By Prof. Timo Salmi Wed 01-Jan-92
*
* To compile these macros apply QMAC DATE.MAC DATE.QMA /A- /B
*
* The QMAC.EXE macro translator is from
* garbo.uwasa.fi:/pc/editor/qmac215.zip
* (Also the earlier version 2.1 will do).
*
* To make these macros available you can e.g. first invoke the main menu
* (usually F10) and select Macro: Read Macro: date.mac. Then you can
* invoke the commands with ALT-4, ALT-5 and ALT-6, respectively.
*
* To write the current date and time like Thu 26-Dec-91 08:36:18
* use alt-4 alt-5 atl-6 in succession.
* ┌───────────────────────────────────────────────────────────┐
* │ Insert the date and convert the month into letters, ALT-4 │
* └───────────────────────────────────────────────────────────┘
@4 MacroBegin
*
* Use a temporary file
EditFile "$qedbuff.tmp" Return
*
* Invoke the date and go to its beginning
InsertDate
MarkBlockEnd
WordLeft WordLeft WordLeft WordLeft
MarkBlockBegin
*
* Replace the month number with the three-letter format
* If you want a longer format, just edit the month names accordingly
FindReplace " 01-" Return " Jan-" Return Return
JFalse label2:
"y"
label2:
FindReplace " 02-" Return " Feb-" Return Return
JFalse label3:
"y"
label3:
FindReplace " 03-" Return " Mar-" Return Return
JFalse label4:
"y"
label4:
FindReplace " 04-" Return " Apr-" Return Return
JFalse label5:
"y"
label5:
FindReplace " 05-" Return " May-" Return Return
JFalse label6:
"y"
label6:
FindReplace " 06-" Return " Jun-" Return Return
JFalse label7:
"y"
label7:
FindReplace " 07-" Return " Jul-" Return Return
JFalse label8:
"y"
label8:
FindReplace " 08-" Return " Aug-" Return Return
JFalse label9:
"y"
label9:
FindReplace " 09-" Return " Sep-" Return Return
JFalse label10:
"y"
label10:
FindReplace " 10-" Return " Oct-" Return Return
JFalse label11:
"y"
label11:
FindReplace " 11-" Return " Nov-" Return Return
JFalse label12:
"y"
label12:
FindReplace " 12-" Return " Dec-" Return Return
JFalse label13:
"y"
*
label13:
*
* Delete the first two digits in the year
* Comment away these three lines if to do not want the deletion
GotoBlockEnd
CursorLeft CursorLeft CursorLeft CursorLeft
BackSpace BackSpace
*
* Assure that the line feed is not included
GotoBlockEnd
CursorRight CursorRight "marker"
GotoBlockEnd
*
* Move the results to the actual file being edited
PrevFile
MoveBlock
GotoBlockEnd
*
* Discard the temporary file
EditFile "$qedbuff.tmp" Return
Exit
"n"
UnmarkBlock
*
* ┌──────────────────────────────────────────────────────┐
* │ Switch the day and the month (European style), ALT-5 │
* └──────────────────────────────────────────────────────┘
@5 MacroBegin
WordLeft WordLeft WordLeft
backspace
WordRight
MarkBlockBegin
WordRight
MarkBlockEnd
WordLeft WordLeft
MoveBlock
UnmarkBlock
WordRight WordRight WordRight
" "
* ┌──────────────────────────────────────────────┐
* │ Insert the time in an ordinary format, ALT-6 │
* └──────────────────────────────────────────────┘
@6 InsertTime